import request from '@/utils/HttpRequest'

/**
 * 游戏商品
 */
export default {

    //获取首页banner
    getBannerInfoList() {
        return request({
            url: '/gmmallproduct/banner/list',
            method: 'get',
        })
    },

    //获取游戏详情
    getGameInfo(id) {
        return request({
            url: '/gmmallproduct/goods/info/' + id,
            method: 'get',
        })
    },

    //根据游戏类别获取
    getGameGoodsByTabsInfo(page, activeName) {
        return request({
            url: '/gmmallproduct/goods/list',
            method: 'get',
            params: {
                page: page,
                catId: activeName
            }
        })
    },

    //游戏条件获取
    getGameGoodsInfoByCond(page, types, price, catId) {
        return request({
            url: '/gmmallproduct/goods/condlist',
            method: 'get',
            params: {
                page: page,
                types: types,
                price: price,
                catId: catId
            }
        })
    },

    //获取促销的游戏列表
    getGameGoodsSaleInfo() {
        return request({
            url: '/gmmallcoupon/goodssale/list',
            method: 'get',
        })
    },

    getGameNameForInput(name) {
        return request({
            url: '/gmmallproduct/goods/getGameNameOfInput',
            method: 'get',
            params: {
                name: name
            }
        })
    },

    //订单页面获取游戏信息
    getOrderGameInfo(params) {
        return request({
            url: '/gmmallproduct/goods/orderGameInfo',
            method: 'get',
            params: params
        })
    }

}